package com.jp.memory;

import java.sql.Time;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

public class MyTest1 {
    public static void main(String[] args) {
        List<MyTest1> list = new ArrayList<>();
        for(int i=0;i<100000;i++){
            list.add(new MyTest1());
            try {
                TimeUnit.MICROSECONDS.sleep(1);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.gc();
           //System.out.println(list.size());
        }


//        for (int i=0;i<list.size();i++){
//            System.out.println("i:"+i+','+list.get(i));
//        }

        try {
            TimeUnit.SECONDS.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
